<div class="modal fade bs-example-modal-lg" tabindex="-1" aria-labelledby="msg_dialog_title" id="order-detail-modal" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <a href="javascript:void(0);" title="关闭" class="close" data-dismiss="modal">×</a>
                <h4 class="modal-title">
                    订单详情
                </h4>
            </div>
            <div class="modal-body">
                <div class="panel panel-default">
                    <div class="panel-body order-main">
                        {@each data as item}
                        <div class="sub-model">
                            <h3>送货信息</h3>
                            <div>
                                <p>收货人：${item.showAddressUser|empty} ${item.showMobile|empty}</p>
                                <p>下单人：${item.orderNick|empty} ${item.orderMobile|empty}</p>
                                <p>下单人ID：${item.buyerId|empty} </p>
                                <p>地址：
                                    {@if item.buyerCity}
                                        ${item.buyerCity|empty}
                                    {@else}
                                        ${item.cityName|empty}
                                    {@/if}
                                    ${item.showDistrict|empty}${item.showAddress|empty}
                                </p>
                                <p>备注：{@if item.comment}${item.comment}{@else}无{@/if}</p>
                            </div>
                        </div>
                        <div class="sub-model">
                            <h3>订单信息</h3>
                            <div>
                                <p>所在城市：${item.cityName|empty}</p>
                                <p>地标信息：${item.landmarkName|empty}</p>
                                <p>订单ID：${item.bizOrderId}</p>
                                {@if item.orderType == 2}
                                <p>订单来源：${item.attributes.from|showChannel}</p>
                                {@/if}
                                <p>店铺名称：${item.shopName|empty}</p>
                                <p>店铺ID：${item.shopId}</p>
                                <p>付款方式：${item|checkOrderPayType}</p>
                                {@if item.payStatus == 2}
                                <p>付款时间：${item.buyer2uspayTime|formatDate}</p>
                                {@/if}
                                {@if item.branchOutDeliveryCode}<p>外部品牌订单取货码：${item.branchOutDeliveryCode}</p>{@/if}
                                {@if item.confirmDeliveryTime}<p>物流确认送达时间：${item.confirmDeliveryTime|formatDate}</p>{@/if}


                                {@if item.deliveryType != null&&item.orderType!=6}
                                    <p>配送类型：${item.deliveryType|checkDeliveryType}</p>
                                {@/if}


                                <!--{@if item.orderType == 2}<p>物流信息：${item.attributes.logisticsCompanyName|empty}:${item.attributes.logisticsNo|empty}</p>{@/if}-->
                                {@if item.orderType == 4 || item.orderType == 2 || item.orderType == 5}<p>物流信息:$${item|renderSendLogisticsnos}</p>{@/if}
                                <!--{@if item.isResendOrder && item.orderType == 2}-->
                                    <!--<p>物流重发信息:${item.attributes.resendLogisticsCompanyName|empty}:${item.attributes.resendLogisticsNo|empty},重发时间:${item.attributes.resendTime|empty}</p>-->
                                <!--{@/if}-->
                                {@if item.sendTime}<p>发货时间：${item.sendTime|formatDate}</p>{@/if}
                                {@if item.acceptTime}<p>卖家接单时间：${item.acceptTime|formatDate}{@/if}
                                <p>支付状态：{@if item.payStatus==1}待支付{@else}已支付{@/if}</p>
                                <!--{@if item.isAccept == 1}<p>物流状态：${item.logisticsStatus|getLogisticsStatus}</p>{@/if}-->
                                <p>订单状态：${item|checkOrderType} $${item.cancelUser}</p>
                                <p>订单编号：${item.outOrderId}</p>
                                <p>下单时间：${item.showAddressTime|formatDate}</p>
                                {@if item.attributes.outDeliveryPrice}
                                <p>外部配送费：￥${(item.attributes.outDeliveryPrice/100).toFixed(2)}元</p>
                                {@/if}
                                {@if item.attributes.outTotalPrice}
                                <p>外部订单金额：￥${(item.attributes.outTotalPrice/100).toFixed(2)}元</p>
                                {@/if}
                                {@if item.tradeSuccessDatetime}<p>交易成功时间：${item.tradeSuccessDatetime|formatDate}{@/if}
                               
                            <!--
                                <p>订单金额：${(item.originalPrice/100).toFixed(2)}元</p>
                                {@each item.orderFunds as f}
                                {@if f.fundType!= 1 && f.fundType!= 10 && f.fundType!= 11}
                                <p>
                                    <span class="hot">${f.fundType|checkFundType}：</span>
                                    费用：${((f.fund)/100).toFixed(2)}
                                    平台：${((f.platformSubsidy)/100).toFixed(2)}
                                    商家：${((f.sellerSubsidy)/100).toFixed(2)}
                                </p>
                                {@/if}
                                {@/each}
                                <p>共优惠：${(item.orderFunds|sumSalePrice)}元</p>

                                -->


                                {@if (item.orderType == 4 || item.orderType == 2 || item.orderType == 5) && item.preSaleSendStartTime && item.preSaleSendEndTime}
                                <p>预计送达开始时间：<span class="J_ShowPreStartTime">${item.preSaleSendStartTime|formatDate}</span></p>
                                <p>预计送达结束时间：<span class="J_ShowPreEndTime">${item.preSaleSendEndTime|formatDate}</span></p>
                                {@if item.isPreSale && (item.status==2 || item.status==3) && (item.logisticsStatus==0||item.logisticsStatus==1||item.logisticsStatus==2||item.logisticsStatus==5)}
                                <p>
                                    <button type="button" id="updatePreTime" data-id="${item.itemId}"  class="btn btn-primary">修改时间</button>
                                    <span class="J_PreDate"></span>
                                </p>
                                {@/if}
                                {@/if}
                            </div>
                        </div>
                        <style type="text/css">
                            .buyer-funds{
                                width:30%;
                                float:left;
                                margin-left: 15%;
                            }
                            .seller-funds{
                                width:48%;
                                float:right;
                            }
                            .buyer-seller-funds label{
                                width:100px;
                                display: inline-block;
                                vertical-align: middle;
                                color:#f00;
                                font-weight: 400;
                            }

                            .buyer-seller-funds .label-total{
                                
                                color:#000;
                            }
                            .buyer-seller-funds li{
                                list-style: none;
                            }
                        </style>
                        <div class="buyer-seller-funds clearfix">
                            {@if item.onlinePayType<10&&item.orderType != 6}
                            <ul class="buyer-funds">
                                {@each item.buyerOrderFunds as bf}
                                    <li>
                                        <label>
                                            ${bf.name}
                                        </label>
                                        <span>
                                            ${bf.price}
                                        </span>
                                    </li>
                                {@/each}
                                <li>
                                    <label class="label-total">
                                        买家实付
                                    </label>
                                    <span>
                                        ￥ ${(item.totalPrice/100).toFixed(2)}
                                    </span>
                                </li>
                            </ul>
                            {@/if}
                            <div class="seller-funds">
                                {@each item.sellerOrderFunds as sf}
                                    <li>
                                        <label>
                                            ${sf.name}
                                        </label>
                                        <span>
                                            ${sf.price}
                                        </span>
                                    </li>
                                {@/each}
                                <li>
                                    <label class="label-total">
                                        卖家实收
                                    </label>
                                    <span>
                                        ￥ ${(item.sellerBenefit/100).toFixed(2)}
                                    </span>
                                </li>
                            </div>
                        </div>
                        <div class="sub-model">
                            <h3>商品信息</h3>
                            <table data-toggle="table">
                                <tbody>
                                {@each item.subOrders as order}
                                <tr  class="tr-class-5">
                                    <td class="td-class-5">
                                        <span class="commodity-img">
                                        <img src="http://imgsize.52shangou.com/img/${order.itemPicUrl}.600*600.jpg@1e_100w_100h_1c_0i_1o_90Q_1x.jpg"></span>
                                    </td>
                                    <td>
                                        ${order.itemName}
                                        {@if order.type == 2}
                                            <span class="label label-danger">赠品</span>
                                        {@/if}
                                    </td>
                                    <td>商品id: ${order.itemId}</td>
                                    <td>(${order.unit|empty} X ${order.buyAmount})</td>
                                    <td>
                                        ${(order.totalPrice/100).toFixed(2)}元
                                        <p>
                                            {@if order.itemOriginPrice}
                                                <s>${(order.itemOriginPrice/100).toFixed(2)}</s>
                                            {@/if}
                                        </p>
                                    </td>
                                </tr>
                                {@/each}
                                </tbody>
                            </table>
                            <div class="order-items-sum">共计 ${item.buyAmount} 件商品, 总计：<span>${(item.totalPrice/100).toFixed(2)}</span>元</div>
                        </div>
                        <div class="sub-model">
                            <div class="col-md-6">
                                <a class="btn btn-primary"  target="_blank"  href="${item.remarkUrl}?biz_order_id=${item.bizOrderId}">备注</a>
                            </div>
                            <div class="col-md-6 text-right">
                                {@if item.orderType!=6 && (item.status!=5 && item.attributes.outWay != 2) && item.onlinePayType != 12}<a class="btn btn-danger J_RemoveOrder"  data-id=${item.bizOrderId} href="javascript:void(0);">取消订单 </a>{@/if}
                            </div>
                        </div>
                        {@if item.mainRate}
                        <div class="sub-model">
                            <h3>{@if item.mainRate.type == 0}好评{@else}差评{@/if}</h3>
                            {@if item.mainRate.type == 0}
                                {@each item.mainRate.rateItemVoList as rateItem}
                                    <p>${rateItem.categoryName|empty}：${rateItem.star|empty} 星</p>
                                {@/each}
                            {@else}
                                {@each item.mainRate.rateItemVoList as rateItem}
                                <p>
                                    ${rateItem.categoryName|empty}：
                                    {@each rateItem.tags as rateTag}
                                        <span class="label label-danger">${rateTag.name|empty}</span>
                                    {@/each}
                                        ：${rateItem.comment|empty}
                                </p>
                                {@/each}
                            {@/if}
                            <p>
                                {@if item.mainRate.picList}
                                    {@each item.mainRate.picList as pic}
                                        <span class="commodity-img">
                                            <a href="http://imgsize.52shangou.com/img/${pic}" target="_blank"><img src="http://imgsize.52shangou.com/img/${pic}.600*600.jpg@1e_100w_100h_1c_0i_1o_90Q_1x.jpg">
                                            </a>
                                        </span>
                                    {@/each}
                                {@/if}
                                {@if item.secondRate && item.secondRate.picList}
                                    {@each item.secondRate.picList as pic}
                                        <span class="commodity-img">
                                            <a href="http://imgsize.52shangou.com/img/${pic}" target="_blank"><img src="http://imgsize.52shangou.com/img/${pic}.600*600.jpg@1e_100w_100h_1c_0i_1o_90Q_1x.jpg">
                                            </a>
                                        </span>
                                    {@/each}
                                {@/if}
                            </p>
                            <p>用户描述：${item.mainRate.comment|empty}</p>
                            {@if item.secondRate}
                            <p>追加评论：${item.secondRate.comment|empty}</p>
                            {@/if}
                            <form class="form-horizontal" role="form" id="rate_form" action="javascript:void(0);" method="post">
                                <div class="form-group">
                                    <label for="status" class="col-sm-2 control-label">处理结果:</label>
                                    <div class="col-sm-10">
                                        <select id="status" name="status" class="form-control"  {@if item.mainRate.status == 2}disabled{@/if}>

                                            <option value="0" {@if item.mainRate.status == 0}selected{@/if}>未理中</option>
                                            <option value="2" {@if item.mainRate.status == 2}selected{@/if}>已处理</option>
                                        </select>
                                    </div>
                                </div>
                                {@if item.mainRate.status == 0}
                                <div class="form-group">
                                    <div class="col-sm-11" style="text-align: right">
                                        <button type="button" class="btn btn-primary" data-id="${item.mainRate.bizOrderId}" id="save_rate">保 存</button>
                                    </div>
                                </div>
                                {@/if}
                            </form>
                        </div>
                        {@/if}
                        <div class="sub-model-shop">
                            <p>接单员：{@if item.acceptUser} {@if item.acceptUser.realName} ${item.acceptUser.realName}{@else}${item.acceptUser.userNick|empty}{@/if} ${item.acceptUser.mobile|empty}{@/if}</p>
                            <p>配送员：{@if item.deliveryerName}${item.deliveryerName}{@/if} {@if item.deliveryerMobile}${item.deliveryerMobile}{@/if}</p>
                            <p>负责小二：${item.xiaoErNick|empty} ${item.xiaoErMobile|empty}</p>
                            <p>负责主管：${item.managerNick|empty} ${item.managerMobile|empty}</p>
                        </div>
                        <div class="sub-model sub-model-remind">
                            <h3>催单记录： (当前催单对象：<span class="J_RemindObject">${item.shopContent.ownerName}</span> <span class="J_RemindObjectMobile">${item.shopContent.shopOwnerMobile}</span>)
                                {@if item.status==2}<button type="button" id="remindOrder" data-mobile="${item.shopContent.shopOwnerMobile}" class="btn btn-primary">立即催单</button>{@/if}</h3>
                            <ul>
                                {@each item.customerReminderMark as mark}
                                <li><p class="cuidan"><span>催单时间：${mark.gmtCreate|formatDate} </span>&nbsp;<span>催单人：${mark.userName}</span></p></li>
                                {@/each}
                            </ul>
                        </div>
                        <input type='hidden' value='${item.buyerId}' class="J_BuyerId" />
                        <input type='hidden' value='${item.bizOrderId}' class="J_BizOrderId" />
                        {@/each}
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关 闭</button>
            </div>
        </div>
    </div>
</div>

